import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

//主路由
const RecommendView = () => import('@/views/recommend/RecommendView')
const RecentPlay = () => import('@/views/recentplay/RecentPlay')
const SongsMenuDetail = () => import('@/views/detail/songsmenudetail/SongsMenuDetail')
const ArtistDetail = () => import('@/views/detail/artistdetail/ArtistDetail')
const AlbumDetail = () => import('@/views/detail/albumdetail/AlbumDetail')
const UserDetail = () => import('@/views/detail/userdetail/UserDetail')
const VideoDetail = () => import('@/views/detail/videodetail/VideoDetail')
const SearchDetail = () => import('@/views/detail/searchdetail/SearchDetail')
//发现页
const HomePage = () => import('@/views/home/HomePage')
const PersonRecommend = () => import("@/views/home/personrecommend/PersonRecommend")
const SongMenu = () => import("@/views/home/songmenu/SongMenu")
const Rank = () => import("@/views/home/rank/Rank")
const Singer = () => import("@/views/home/singer/Singer")
const NewSongs = () => import("@/views/home/newsongs/NewSongs")
//视频页
const VideoView = () => import('@/views/videoview/VideoView')
const Video = () => import('@/views/videoview/video/Video')
const MV = () => import('@/views/videoview/mv/MV')




const routes = [
  {
    path: '/',
    redirect: '/home'
  },
  {
    path: '/home',
    component: HomePage,
    redirect: '/personrecommend',
    children: [
      { path: "/personrecommend", component: PersonRecommend },
      { path: "/songmenu", component: SongMenu },
      { path: "/rank", component: Rank },
      { path: "/singer", component: Singer },
      { path: "/newsongs", component: NewSongs }
    ]
  },
  {
    path: '/videoview', component: VideoView, redirect: '/video', children: [
      { path: "/video", component: Video },
      { path: "/mv", component: MV }
    ]
  },
  { path: '/recommend', component: RecommendView },
  { path: '/recentplay', component: RecentPlay },
  { path: '/songsmenudetail/:lid', component: SongsMenuDetail, children: [] },
  { path: '/artistdetail/:aid', component: ArtistDetail, children: [] },
  { path: '/albumdetail/:mid', component: AlbumDetail, children: [] },
  { path: '/userdetail/:uid', component: UserDetail, children: [] },
  { path: '/videodetail/:vid', component: VideoDetail, children: [] },
  { path: '/searchdetail/:value', component: SearchDetail, children: [] },
]
const router = new VueRouter({
  mode: 'hash',
  routes
})


export default router
